<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>群聊天记录列表</title>
    <?php PrintPageHead(); ?>
    <link href="../resource/css/hermes.css" rel="stylesheet">
    <link href="../resource/js/calendar/calendar-blue.css" type="text/css" rel="stylesheet">
    <script src="../resource/js/calendar/calendar.js" type="text/javascript"></script>
    <script src="../resource/js/hermes.js"></script>
    <style type="text/css">
        .divleft{width: 25%; float: left; text-align:left; border-right: solid 1px #d5d5d5; margin-right: 2% }
        .divcenter{width: 25%; float: left; text-align:left; border-right: solid 1px #d5d5d5; margin-right: 2%}

        .divright{ width: 15%; float: left; text-align:left;  margin-right: 2%}
        .position {
            position: absolute;
            display: none;
            z-index: 15;
            width: 400px;
            height: 40px;
            margin: -20px 0 0 -75px;
            padding: 0 10px;
            background: #eee;
            line-height: 2.4;
            cursor:pointer;
        }
    </style>
    <?php
    if (!array_key_exists("公众号ID",$_SESSION)) {
        header("Location:back.php");
    }
    pdo()->beginTransaction();
    $bm=new C后台管理员();
    $本页面 = 'back.php?state=back10QunLT_List';
    $Get群聊天列表=$bm->Get群聊天列表($_GET['page'],$_GET,$_POST,$_GET['id']);
    //var_dump($_POST);
    ?>
</head>
<body>


<div class="container-fluid">
    <?php include_once 'back_header.php'; ?>
    <div class="panel panel-primary">
        <div class="panel-heading text-center"><h3 class="panel-title">群聊天记录列表</h3></div>
        <div class="panel-body" style="text-align:center">
            <div style="margin: 0 0 10px 0;text-align:left"><b style="color:#3c763d;font-size: 16px;">聊天记录查询</b><br/>
                <form action="" method="post">
                    姓名：<input type="text" name="name" value="<?=$_POST['name']?>">&nbsp;&nbsp;
                    聊天记录：<input type="text" name="keywords" value="<?=$_POST['keywords']?>">&nbsp;&nbsp;
                    <button type="submit"  class="btn btn-default btn-success ">&nbsp;查 询&nbsp;</button></form></div>
            <div class="panel-group"  id="accordion" role="tablist" aria-multiselectable="true">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="row" >
                            <div class="divleft">
                                成员名称
                            </div>
                            <div class="divcenter">
                                内容
                            </div>
                            <div class="divcenter">
                                聊天类型
                            </div>
                            <div class="divright" style="text-align:center">
                                操作
                            </div>
                        </div>
                    </div>
                </div>
                <?php foreach($Get群聊天列表['result'] as $v){?>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="row" >
                                <div class="divleft">
                                    <?=$v['name']?>&nbsp;
                                </div>
                                <div class="divcenter">

                                    <?php

                                    if($v['聊天类型']=='语音'){

                                        echo '<audio style="display:block;" src="http://www.'.$_SERVER['HTTP_HOST'].'/Ram_disk/'.$v['serverid'].'.mp3"   controls="controls"></audio>';
                                    }else {

                                        echo $v['聊天内容'].'　　　&nbsp;';

                                    }

                                    ?>
                                </div>
                                <div class="divcenter">
                                    <?=$v['聊天类型']?>
                                </div>
                                <div class="divright" style="text-align:center">
                                    <a href="#" onclick="fun('<?=$v['id']?>')">删除</a><input type="hidden" value="<?=$本页面?>&id=<?=$v['群id']?>" id="链接"/>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php }
                if(!$Get群聊天列表['result']){
                    ?>
                    <div class="panel-heading text-center"><h3 class="panel-title">没有数据 !!!</h3></div>
                <?php }?>
            </div>
            <?=$Get群聊天列表['show']?>
        </div>

    </div>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="../resource/js/jquery-1.11.1.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="../resource/js/bootstrap.min.js"></script>
<script language="JavaScript">
    $(function(){
        $(".fun").click(function(){
            $(this).next("div").show();
        })
        $(".fun1").click(function(){
            $(this).parent("div").hide();
        })
    })
    function fun(聊天记录id){
        var 链接 = $("#链接").val();
        if(window.confirm('您确定要删除这条聊天记录吗?')){
            $.ajax({
                type:'post',
                url:'BackSellerAjax.php?businessFlag=删除群聊天',
                data:{聊天记录id:聊天记录id},
                success:function(msg){
                    if(msg){
                        alert('删除成功!');
                        window.location.href=链接;
                    }else{
                        alert('删除失败!');
                    }
                }
            })
        }
    }
</script>
</body>
</html>